home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / public / ghostscript / src / iutil.h < prev    next >
C/C++ Source or Header  |  1994-08-01  |  3KB  |  80 lines

  1. /* Copyright (C) 1991, 1992 Aladdin Enterprises.  All rights reserved.
  2.  
  3. This file is part of Ghostscript.
  4.  
  5. Ghostscript is distributed in the hope that it will be useful, but
  6. WITHOUT ANY WARRANTY.  No author or distributor accepts responsibility
  7. to anyone for the consequences of using it or for whether it serves any
  8. particular purpose or works at all, unless he says so in writing.  Refer
  9. to the Ghostscript General Public License for full details.
  10.  
  11. Everyone is granted permission to copy, modify and redistribute
  12. Ghostscript, but only under the conditions described in the Ghostscript
  13. General Public License.  A copy of this license is supposed to have been
  14. given to you along with Ghostscript so you can know your rights and
  15. responsibilities.  It should be in a file named COPYING.  Among other
  16. things, the copyright notice and this notice must be preserved on all
  17. copies.  */
  18.  
  19. /* iutil.h */
  20. /* Prototypes for procedures in iutil.c */
  21.  
  22. /* ------ Object utilities ------ */
  23.  
  24. /* Copy refs from one place to another. */
  25. /* (If we are copying to the stack, we can just use memcpy.) */
  26. extern void refcpy_to_new(P3(ref *to, const ref *from, uint size));
  27. extern int refcpy_to_old(P5(ref *aref, uint index, const ref *from, uint size, const char *client_name));
  28.  
  29. /* Fill an array with nulls. */
  30. extern void refset_null(P2(ref *to, uint size));
  31.  
  32. /* Compare two objects for equality.  Return 1 if equal, 0 if not. */
  33. extern int obj_eq(P2(const ref *, const ref *));
  34.  
  35. /* Create a printable representation of an object, a la cvs. */
  36. /* Return 0 if OK, <0 if the destination wasn't large enough. */
  37. extern int obj_cvs(P4(const ref *, byte *, uint, uint *));
  38.  
  39. /* Get an element from an array (packed or not). */
  40. extern int array_get(P3(const ref *, long, ref *));
  41.  
  42. /* Check to make sure an interval contains no local object references. */
  43. /* Return 0 or e_invalidaccess. */
  44. extern int refs_check_global(P2(const ref *, uint));
  45.  
  46. /* ------ String utilities ------ */
  47.  
  48. /* Convert a C string to a Ghostscript string */
  49. extern int string_to_ref(P3(const char *, ref *, const char *));
  50.  
  51. /* Convert a Ghostscript string to a C string. */
  52. /* Return 0 iff the buffer can't be allocated. */
  53. extern char *ref_to_string(P2(const ref *, const char *));
  54.  
  55. /* ------ Operand utilities ------ */
  56.  
  57. /* Get N numeric operands from the stack. */
  58. /* Note that the first argument must be ref * rather than os_ptr, */
  59. /* because num_params is sometimes used elsewhere than */
  60. /* on the operand stack. */
  61. extern int num_params(P3(const ref *, int, float *));
  62.  
  63. /* Get a real parameter. */
  64. extern int real_param(P2(const ref *, float *));
  65.  
  66. /* Make real values on the stack. */
  67. extern void make_reals(P3(ref *, const float *, int));
  68.  
  69. /* Define the gs_matrix type if necessary. */
  70. #ifndef gs_matrix_DEFINED
  71. #  define gs_matrix_DEFINED
  72. typedef struct gs_matrix_s gs_matrix;
  73. #endif
  74.  
  75. /* Check for a matrix operand with read access. */
  76. extern int read_matrix(P2(const ref *, gs_matrix *));
  77.  
  78. /* Check for a matrix operand with write access. */
  79. extern int write_matrix(P1(ref *));
  80.